<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\ListController;
use common\models\articles\Articles;
use common\models\member\Member;
use common\models\category\Category;
use common\models\Fenhuigrade\Fenhuigrade;
    $fenhui = Fenhuigrade::find()->where(['status' =>10])->asArray()->all();
?>
    <!--content-->
    <div class="content">
        <div class="w1113 bgd-ff mt10 mb10">
            <span class="abwz">
                您所在的位置：<a href="<?= yii\helpers\Url::to(['/']);?>">首页</a> ><a href="<?= yii\helpers\Url::to([$parent['type'], 'id' => $parent['id']]); ?>"><?=$parent['name'];?></a> ><a href="<?= yii\helpers\Url::to([$cat['type'], 'id' => $cat['id']]); ?>"><?=$cat['name']?></a>
            </span>
        </div>
        <div class="w1113 bgd-ff">
            <div class="clearFloat pl20 pr20 pt15 pb50">
                <div class="ableft floatLeft">
                    <div class="ablewidt">
                        <h3 class="anh3">协会</h3>
                        <div class="jquery-accordion-menu">
                            <ul  class="acb">
                                <?php foreach($child as $t){ ?>
                                    <li <?php if($cat['id'] == $t['id']){ echo "class='active'";}?>>
                                        <?php if(!empty($t['zlm'])){ ?>
                                        <a>
                                            <?php }else{ ?>
                                            <a href="<?= yii\helpers\Url::to([$t['type'], 'id' => $t['id']]); ?>">
                                                <?php } ?>
                                                <?php echo $t['name']; ?></a>
                                            <?php if(!empty($t['zlm'])){ ?>
                                                <ul class="submenu">
                                                    <?php foreach ($t['zlm'] as $pz){ ?>
                                                        <li><a href="<?= yii\helpers\Url::to([$pz['type'],'id' => $pz['id']]); ?>"><?=$pz['name']; ?></a></li>
                                                    <?php } ?>
                                                    <?php foreach($fenhui as $fh){ ?>
                                                        <li><a href="<?= yii\helpers\Url::to(['fenhui/list' , 'id' => $fh['id']]);?>"><?=$fh['name']; ?></a></li>
                                                    <?php } ?>
                                                </ul>
                                            <?php } ?>
                                    </li>
                                <?php } ?>
                            </ul>
                        </div>
                    </div>
                    <script type="text/javascript">
                        jQuery(document).ready(function () {
                            jQuery(".jquery-accordion-menu").jqueryAccordionMenu();

                        });

                        $(function(){
                            //顶部导航切换
                            $(".acb li").click(function(){
                                $(".acb li.active").removeClass("active")
                                $(this).addClass("active");
                            })
                        })
                    </script>
                </div>
                <div class="abright floatRight">
                    <div class="abrwidth">
                        <div class="clearFloat abrwidt">
                            <h3 class="xhjsh3">
                                <font class="ttt"><?= $article['title'];?></font>
                                <span class="xhjstime"><?= date('Y-m-d H:i:s',$article['updated_at']);?><div style="display:inline-block; float:right;" class="bdsharebuttonbox"><a href="#" class="bds_more" data-cmd="more"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"16"},"share":{},"image":{"viewList":["weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script></span>
                            </h3>
                            <div class="clearFloat xhp">
                                <p>
                                    <?= $article['content'];?>
                                </p>
                            </div>
                        </div>
                        <div class="clearFloat xhxgxw">
                            <h3 class="xgxwtit">Related news</h3>
                            <div class="xgxwcont">
                                <ul>
                                    <?php
                                    $num = 0;
                                     foreach($articles as $k=>$t){ 
                                        if($num<5){
                                            $num++;
                                    ?>
                                    <li>
                                        <a href="<?= yii\helpers\Url::to([$cat['ctype'], 'id' => $t['id']]); ?>"><?=$t['title'];?></a>
                                    </li>
                                    <?php 
                                        }
                                    }
                                     ?>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--content end-->